<template>
  <view class="apply-sucess">
    <!-- #ifdef H5 -->
    <van-nav-bar @click-left="onClickLeft" left-arrow></van-nav-bar>
    <!-- #endif -->
    <view class="content">
      <image class="sucessImg" :src="`${resUrl}mine/sucess.png`"></image>
      <view class="tips">我们已接收到您的开票申请，审核通过后将尽快为您办理！</view>
    </view>
    <view class="bottom-wrap" :style="styleBottom">
      <button class="bnt-wrap bnt-pay" @tap="next">完成</button>
    </view>
  </view>
</template>

<script lang="ts" setup>
import { getSystemInfo, setToastInstance, systemInfo } from '@mixins/info';
// #ifdef MP-WEIXIN
import { useToast } from '@/components/wxToast';
setToastInstance(useToast());
// #endif

// 分享
onShareAppMessage(() => {
  return {
    title: '',
    path: '/pages/stationMap/stationMap',
  };
});

const resUrl = import.meta.env.VITE_VUE_APP_RES;
const styleBottom = `height: calc(124rpx + ${getSystemInfo().safeBottom}px)`;
const next = () => {
  uni.$emit('billType', 'billingHistory');
  uni.navigateBack({
    delta: 3,
  });
};
// #ifdef H5
const onClickLeft = () => {
  uni.navigateBack();
};
setTimeout(() => {
  const navBarEle = document.querySelector('.van-nav-bar') as HTMLElement;
  navBarEle.style.paddingTop = `${systemInfo.statusBarHeight}px`;
});
// #endif
</script>

<style lang="scss" scoped>
.apply-sucess {
  .content {
    text-align: center;
    margin-top: 100px;
    .sucessImg {
      width: 177px;
      height: 140px;
    }
    .tips {
      width: 240px;
      margin: 0 auto;
      margin-top: 40px;
      font-size: 16px;
      line-height: 24px;
      color: #242424;
    }
  }
  .bottom-wrap {
    position: fixed;
    width: 100vw;
    bottom: 0;
    background-color: #fff;
    z-index: 999;
    border-top: 1px solid #f2f2f2;
    .bnt-pay {
      margin: 9px 0 9px 16px;
      width: 343px;
      height: 44px;
      border-radius: 50px;
    }
  }
}
</style>
